{include file="public/header" /}
<style>
    .layui-form-label{
        width: 100px;
    }
    .layui-input-block{
        margin-left: 130px;
    }
    .layui-elem-field .layui-form-checkbox{
        margin: 20px 0px 20px 30px;
    }
    .layui-elem-field legend .layui-form-checkbox{
        margin: 0px;
    }
</style>
</head>

<body>
<form class="layui-form" action="" style="padding: 20px;">
    <input type="hidden" name="group_id" value="{$group_id|default=0}">
    {:setGroupHtml($menuAllList,$menus);}
    <div class="layui-form-item" style="margin-left: 50px;">
        <button class="layui-btn" lay-submit lay-filter="formDemo" >立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
</form>
</body>
</html>

<script>
    layui.use('form', function(){
        var form = layui.form;
        form.render();
        //监听提交
        form.on('submit(formDemo)', function(data){
            post_sub("{:url('Admins/setGroup')}",data.field);
            return false;
        });
    });
</script>